package com.sinosoft.cloud.access.service;

import com.sinosoft.cloud.access.net.AccessControl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2018-1-5.
 */
@Controller
public class UpdateContNoFlagController {

    private final Log logger = LogFactory.getLog(getClass());

    @Autowired
    AccessControl accessControl;

    /**
     * 临时增加微服务调用开关
     * @param flag
     * @return
     */
    @GetMapping("/updateContNo/reflesh/{flag}")
    @ResponseBody
    public String updateContNoFlageflesh(@PathVariable("flag") String flag){
        accessControl.setUpdateContNoFlag(flag);
        logger.info("动态刷新调用微服务开关成功！" + "开关状态：" + accessControl.getUpdateContNoFlag());
        return accessControl.getUpdateContNoFlag();
    }

}
